package co.com.inventarios.modelo;

import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Catvtapro entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CATVTAPRO", schema = "MANAGER", uniqueConstraints = {})
public class Catvtapro implements java.io.Serializable {

	// Fields

	private CatvtaproId id;
	private Cataventa cataventa;
	private Unimed unimed;
	private Producto producto;
	private Double cvpvalor;
	private Long cvpactivo;
	private Timestamp cvplogfec;
	private Dlluser dlluser;
	// Constructors

	/** default constructor */
	public Catvtapro() {
	}

	/** minimal constructor */
	public Catvtapro(CatvtaproId id, Cataventa cataventa, Unimed unimed,
			Producto producto, Double cvpvalor) {
		this.id = id;
		this.cataventa = cataventa;
		this.unimed = unimed;
		this.producto = producto;
		this.cvpvalor = cvpvalor;
	}

	/** full constructor */
	public Catvtapro(CatvtaproId id, Cataventa cataventa, Unimed unimed,Dlluser dlluser,Timestamp cvplogfec,
			Producto producto, Double cvpvalor, Long cvpactivo) {
		this.id = id;
		this.cataventa = cataventa;
		this.unimed = unimed;
		this.producto = producto;
		this.cvpvalor = cvpvalor;
		this.cvplogfec = cvplogfec;
		this.dlluser = dlluser;
		this.cvpactivo = cvpactivo;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "cvpcatalog", column = @Column(name = "CVPCATALOG", unique = false, nullable = false, insertable = true, updatable = true, length = 5)),
			@AttributeOverride(name = "cvpproduct", column = @Column(name = "CVPPRODUCT", unique = false, nullable = false, insertable = true, updatable = true, length = 15)),
			@AttributeOverride(name = "cvpunimed", column = @Column(name = "CVPUNIMED", unique = false, nullable = false, insertable = true, updatable = true, length = 4)) })
	public CatvtaproId getId() {
		return this.id;
	}

	public void setId(CatvtaproId id) {
		this.id = id;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CVPCATALOG", unique = false, nullable = false, insertable = false, updatable = false)
	public Cataventa getCataventa() {
		return this.cataventa;
	}

	public void setCataventa(Cataventa cataventa) {
		this.cataventa = cataventa;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CVPUNIMED", unique = false, nullable = false, insertable = false, updatable = false)
	public Unimed getUnimed() {
		return this.unimed;
	}

	public void setUnimed(Unimed unimed) {
		this.unimed = unimed;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CVPPRODUCT", unique = false, nullable = false, insertable = false, updatable = false)
	public Producto getProducto() {
		return this.producto;
	}

	public void setProducto(Producto producto) {
		this.producto = producto;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "CVPLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "CVPLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getCvplogfec() {
		return this.cvplogfec;
	}

	public void setCvplogfec(Timestamp cvplogfec) {
		this.cvplogfec = cvplogfec;
	}

	@Column(name = "CVPVALOR", unique = false, nullable = false, insertable = true, updatable = true, precision = 12)
	public Double getCvpvalor() {
		return this.cvpvalor;
	}

	public void setCvpvalor(Double cvpvalor) {
		this.cvpvalor = cvpvalor;
	}

	@Column(name = "CVPACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getCvpactivo() {
		return this.cvpactivo;
	}

	public void setCvpactivo(Long cvpactivo) {
		this.cvpactivo = cvpactivo;
	}

}